package com.cxyjy.cfyuiapi.controller;

import com.cxyjy.cfyuiapi.service.QueryHistoryService;
import com.cxyjy.common.util.JResponse;
import com.cxyjy.common.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
public class QueryHistoryController {
    @Autowired
    QueryHistoryService queryHistoryService;

    /**
     * @param promptId 可以为空  ps:前端传的格式应为“promptId”而不是“prompt_id”
     * @return
     * @throws IOException
     */
    @GetMapping("/queryComfyUIHistory")
    public JResponse queryComfyUIHistory(String promptId) throws IOException {
        Object result = queryHistoryService.queryhistory(promptId);
        return ResultUtil.success(result);
    }
}
